<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>angular 函数 和 两种不同方式的复制</title>
    <script src="../angular.js"></script>
</head>
<body>
    <div ng-app="gg" ng-controller="ctrl">

    </div>

    <script>
        var mod = angular.module('gg', []);
        mod.controller('ctrl', ['$scope', function ($scope) {
            console.log(angular.version); //版本号
            console.log(angular.lowercase('gggHHNV'));//全部转小写
            console.log(angular.uppercase('hhdhhdFTGYH'));//全部转大写

            var obj = {name : '果果'};
            var obj2 = obj; //obj 和 obj2引用的时同意地址的数据

            obj2.name = '前程';
            console.log(obj);
            console.log(obj2);

            var obj3 = {name : 'gg'};
            var obj4 = {};
            angular.copy(obj3, obj4); //深copy,复制值
            obj4.name = 'qc';
            console.log(obj3);
            console.log(obj4);
        }]);

    </script>
</body>
</html>